<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Ajax</title>
</head>
<body>
  <script>
    var xhr = new XMLHttpRequest()
    console.log('unsent ', xhr.readyState) // unsent  0

    xhr.open('GET', '/account/user/more_info', true)
    console.log('open ', xhr.readyState) // open  1

    xhr.onprogress = function () {
      console.log('onprogress ', xhr.readyState) // onprogress  3
    }

    xhr.onreadystatechange = function () {
      if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
        console.log(xhr.responseText) // {"code":"200","body":"success"}
      }
    }

    xhr.onload = function () {
      console.log('DONE', xhr.readyState) // DONE 4
    }

    xhr.send(null)
  </script>
</body>
</html>